const Controllers = require('../../controllers/Controller.js').controller;
const formatTime3 = require('../../../utils/util.js').formatTime3
Page({
  data: {
    diyList:[],
    array:['套餐卡','充值卡']
  },
  onShow: function (options) {
    this.getDiyList()
  },
  getDiyList(){
    Controllers.shopList({shopId:wx.getStorageSync('shopId')}).then(res=>{
      this.setData({
        diyList:res.data
      })
    })
  },
  addcard(){
    wx.navigateTo({
      url: "/pages/diyActivity/adddiy/adddiy"
    });
  },
  godetail(e){
    wx.navigateTo({
      url: "/pages/diyActivity/detail/detail?id="+e.currentTarget.dataset.id
    });
  },
  godesc(e){
    wx.navigateTo({
      url: "/pages/diyActivity/desc/desc?id="+e.currentTarget.dataset.id
    });
  },
  bindPickerChange(e){
    if(e.detail.value==0){
      wx.navigateTo({
        url: "/pages/diyActivity/adddiy/adddiy"
      });
    }else{
      wx.navigateTo({
        url: "/pages/diyActivity/addcard/addcard"
      });
    }
  },
})